import { createRouter, createWebHistory } from "vue-router";
const Login = () => import("../views/Login/Index.vue");
const Love = () => import("../views/Love.vue");
const MusicDetails = () => import("../views/MusicDetails.vue");
const Empty=()=>import("../components/Empty.vue")
const base=import.meta.env.VITE_BASE
console.log(base)
const routes = [
  {
    path:"/:pathMatch(.*)*",
    component:Empty
  },
  {
    path:'/',
    redirect:"/love"
  },
  {
    path: "/login",
    component: Login,
    name: "Login",
    meta: {
      title: "登录",
    },
  },
  {
    path: "/love",
    component: Love,
    name: "Love",
    meta: {
      title: "我喜欢",
    },
  },
  {
    path: "/details",
    component: MusicDetails,
    name: "MusicDetails",
    meta: {
      title: "我喜欢",
    },
  }
];

// 3. 创建路由实例并传递 `routes` 配置
// 你可以在这里输入更多的配置，但我们在这里
// 暂时保持简单
const router = createRouter({
  // 4. 内部提供了 history 模式的实现。为了简单起见，我们在这里使用 hash 模式。
  history: createWebHistory(base),
  routes, // `routes: routes` 的缩写
});
export default router;
